package Sort;

import java.util.Scanner;

/**
 * @author Liangyaoyun
 */
public class MergeSortSimple {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }
        mergeSort(nums);
        for (int i = 0; i < n; i++) {
            if (i == n - 1) {
                System.out.println(nums[i]);
            } else {
                System.out.print(nums[i] + " ");
            }
        }
    }
    public static void mergeSort(int[] nums) {
        int len = nums.length;
        int tmp;
        if (len % 2 == 0) {
            for (int i = 0; i < nums.length; i += 2) {
                if (nums[i] > nums[i + 1]) {
                    tmp = nums[i];
                    nums[i] = nums[i + 1];
                    nums[i + 1] = tmp;
                }
            }
        } else {
            for (int i = 0; i < nums.length - 1; i += 2) {
                if (nums[i] > nums[i + 1]) {
                    tmp = nums[i];
                    nums[i] = nums[i + 1];
                    nums[i + 1] = tmp;
                }
            }
        }
    }
}
